

function Checkuser(username)
{
    $.ajax({
        url: "ajax.php",
        data: "do=Checkuser&username=" + username,
        async: true,
        type: "POST",
        success: function(result)
        {
            alert('×”×¡×™×¡×ž×� × ×©×œ×—×” ×œ×ž×™×™×œ ×©×œ×š');
        }
    });
}
function show_project_ajax(id, name_session)
{

    $.ajax({
        url: "ajax2.php",
        data: "do=show_project_ajax&id=" + id + "&name_session=" + name_session,
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#content').html(result);
            //document.getElementById('content').innerHTML=result;
            get_name_project_for_add_task(id);
            $('#select_customer').val('none');

        }


    });


}

function get_name_project_for_add_task(id)
{

    $.ajax({
        url: "ajax_new.php",
        data: "do=get_name_project_for_add_task&id=" + id,
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#add_task h3 span').html(result);

        }


    });


}

function show_project_ajax_find(name_project, name_session)
{
    $('#span_send_task').hide();
    $.ajax({
        url: "ajax2.php",
        data: "do=show_project_ajax_find&name_project=" + name_project + "&name_session=" + name_session,
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#content').html(result);
            //document.getElementById('content').innerHTML=result;
            $('#add_task h3 span').html(name_project);
            // $('#span_send_task').css('display','block');
            $('#select_customer').val('none');
        }


    });

}
function send_new_task(id_project, user_id, temp)
{
    $('#add_task  div#loading').css('display', 'block');

    $.ajax({
        url: "ajax2.php",
        data: "do=send_new_task&id_project=" + id_project + "&" + temp,
        async: true,
        type: "POST",
        success: function(result)
        {
            alert(result);
            $('#all_task').before(result).slideDown('slow');
            $('#add_task  div#loading').css('display', 'none');
            $('#lightbox, #lightbox_frame').hide();

            // show_project_ajax(id_project,user_id);

        }


    });
}

function new_message(user_id)
{
    $.ajax({
        url: "ajax2.php",
        data: "do=new_message&user_id=" + user_id,
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#mass #new_message').html(result);


            var x = user_id;
            // setInterval("new_message("+x+")",60000);
            if ($('#hid_sound_new').val() <= $('#hid_sound_old').val())
            {
                $('#hid_sound_old').val($('#hid_sound_new').val());
            }
            else
            {
                $('#hid_sound_old').val($('#hid_sound_new').val());
                $('embed').remove();
                $('audio').remove();


                $('body').append(''/*'<embed src="./style/komp3_new.wma" type="audio/mp3" autostart="true" loop="false" volume="100" hidden="true" /> <audio controls="controls">  <source src="./style/komp3_new.mp3" type="audio/mp3" /> Your browser does not support the audio tag.</audio> '*/);

                /*var audio = document.getElementsByTagName("audio")[0];
                 audio.play();*/
            }
        }


    });
}

function gomassage(name_class, id_task, id_comment, user_id)
{
    $.ajax({
        url: "ajax2.php",
        data: "do=gomassage&id_task=" + id_task + "&name_class=" + name_class + "&id_comment=" + id_comment + "&user_id=" + user_id,
        async: true,
        type: "POST",
        success: function(result)
        {

            //$('#content').html(result);
            document.getElementById('content').innerHTML = result;
            new_message(user_id);
            $('#span_send_task').css('display', 'none');
        }


    });
}
function change_status(id_status, id_project)
{
    $.ajax({
        url: "ajax2.php",
        data: "do=change_status&id_status=" + id_status + "&id_project=" + id_project,
        async: true,
        type: "POST",
        success: function(result)
        {
            switch (id_status)
            {
                case 1:
                    $('#postponed' + id).css('background', 'url(./style/images/deny_x.png) no-repeat top right');
                    $('#red' + id).css('background', 'url(./style/images/status_btn_red.png) no-repeat top right');
                    $('#yellow' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#orange' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#green' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    break;
                case 2:
                    $('#postponed' + id).css('background', 'url(./style/images/deny_x.png) no-repeat top right');
                    $('#red' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#yellow' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#orange' + id).css('background', 'url(./style/images/status_btn_Orange.png) no-repeat top right');
                    $('#green' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    break;
                case 3:
                    $('#postponed' + id).css('background', 'url(./style/images/deny_x.png) no-repeat top right');
                    $('#red' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#yellow' + id).css('background', 'url(./style/images/status_btn_Yellow.png) no-repeat top right');
                    $('#orange' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#green' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    break;
                case 4:
                    $('#postponed' + id).css('background', 'url(./style/images/deny_x.png) no-repeat top right');
                    $('#red' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#yellow' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#orange' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#green' + id).css('background', 'url(./style/images/status_btn_green.png) no-repeat top right');
                    break;
                case 5:
                    $('#postponed' + id).css('background', 'url(./style/images/deny_x_active.png) no-repeat top right');
                    $('#red' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#yellow' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#orange' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#green' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    break;
            }
        }

    });
}

function change_status_task(id_status, id_task, id)
{
    $('#sbb' + id + ' #traficLight').show();
    $.ajax({
        url: "ajax2.php",
        data: "do=change_status_task&id_status=" + id_status + "&id_task=" + id_task,
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#sbb' + id + ' #traficLight').hide();
            switch (id_status)
            {
                case 1:
                    $('#postponed' + id).css('background', 'url(./style/images/deny_x.png) no-repeat top right');
                    $('#red' + id).css('background', 'url(./style/images/status_btn_red.png) no-repeat top right');
                    $('#yellow' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#orange' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#green' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#sbb' + id + ' .close_task').css('display', 'none');
                    break;
                case 2:
                    $('#postponed' + id).css('background', 'url(./style/images/deny_x.png) no-repeat top right');
                    $('#red' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#yellow' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#orange' + id).css('background', 'url(./style/images/status_btn_Orange.png) no-repeat top right');
                    $('#green' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#sbb' + id + ' .close_task').css('display', 'none');
                    break;
                case 3:
                    $('#postponed' + id).css('background', 'url(./style/images/deny_x.png) no-repeat top right');
                    $('#red' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#yellow' + id).css('background', 'url(./style/images/status_btn_Yellow.png) no-repeat top right');
                    $('#orange' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#green' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#sbb' + id + ' .close_task').css('display', 'none');
                    break;
                case 4:
                    $('#postponed' + id).css('background', 'url(./style/images/deny_x.png) no-repeat top right');
                    $('#red' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#yellow' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#orange' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#green' + id).css('background', 'url(./style/images/status_btn_green.png) no-repeat top right');
                    $('#sbb' + id + ' .close_task').css('display', 'block');
                    break;
                case 5:
                    $('#postponed' + id).css('background', 'url(./style/images/deny_x_active.png) no-repeat top right');
                    $('#red' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#yellow' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#orange' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#green' + id).css('background', 'url(./style/images/status_btn_gray.png) no-repeat top right');
                    $('#sbb' + id + ' .close_task').css('display', 'none');
                    break;

            }

        }

    });
}
function send_mail_postponed(info, id)
{
    $.ajax({
        url: "ajax_new.php",
        data: "do=send_mail_postponed&" + info,
        async: true,
        type: "POST",
        success: function(result)
        {

            $('#if_send').html(result);
            $('#postponed_message' + id).delay(2000).fadeOut();

        }


    });
}
function insert_message(id_task, content, user_id)//×©×œ×™×—×ª ×ª×’×•×‘×” 
{
    $("#loading" + id_task).css('display', 'block');

    $.ajax({
        url: "ajax2.php",
        data: "do=insert_message&id_task=" + id_task + "&content=" + content + "&user_id=" + user_id,
        async: true,
        type: "POST",
        success: function(result)
        {

            // send_mail_contect(id_task,content,user_id);
            $('#part_comments' + id_task).append(result);
            $('#textarea' + id_task).val("×”×§×œ×™×“×• ×ª×’×•×‘×” ×—×“×©×”...");
            $("#loading" + id_task).css('display', 'none');
        }


    });
}
function send_mail_contect(id_task, content, user_id)//×©×œ×™×—×ª ×ª×’×•×‘×” 
{
    $.ajax({
        url: "ajax_new.php",
        data: "do=send_mail_contect&id_task=" + id_task + "&content=" + content + "&user_id=" + user_id,
        async: true,
        type: "POST",
        success: function(result)
        {


            $("#loading" + id_task).css('display', 'none');
        }


    });
}


function get_new_task()//×ž×—×–×™×¨ ×�×ª ×›×œ ×”×”×•×“×¢×•×ª ×©×ž×—×›×•×ª ×œ×�×™×©×•×¨
{
    $.ajax({
        url: "ajax3.php",
        data: "do=get_new_task",
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#content').html(result);
            //document.getElementById('content').innerHTML=result;
            get_tasks_open_admin();
        }


    });
}
function get_tasks_open_admin()//×ž×—×–×™×¨ ×�×ª ×›×œ ×”×”×•×“×¢×•×ª ×©×ž×—×›×•×ª ×œ×�×™×©×•×¨
{
    $.ajax({
        url: "ajax3.php",
        data: "do=get_tasks_open_admin",
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#content').append(result);
            //document.getElementById('content').innerHTML+=result;
        }


    });
}

function get_tasks_open(id)//×ž×—×–×™×¨ ×�×ª ×›×œ ×”×”×•×“×¢×•×ª ×©×ž×—×›×•×ª ×œ×�×™×©×•×¨
{
    $.ajax({
        url: "ajax2.php",
        data: "do=get_tasks_open&id=" + id,
        async: true,
        type: "POST",
        success: function(result)
        {

            $('#content').html(result);
        }


    });
}
function isuser(name_user)
{
    $.ajax({
        url: "ajax_new.php",
        data: "do=isuser&name_user=" + name_user,
        async: true,
        type: "post",
        success: function(result)
        {
            //$('#test').val(result);
            var x = (result);
            $('#test').html(result);
            if ($('#hid_res').val() == 0)
            {
            	alert('המשתמש ' + name_user + 'מוסיף את ');
            	$('#form_new_user').submit();
            }
            else
            {
                alert('המשתמש ' + name_user + 'כבר קיים');
                //$('#form_new_user').submit();
            }
        }

    });

}
function isusercustomer(name_user, id_customer, form)
{
    $.ajax({
        url: "ajax_new.php",
        data: "do=isuser&name_user=" + name_user,
        async: true,
        type: "post",
        success: function(result)
        {
            //$('#test').val(result);
            var x = (result);
            $('#test').html(result);

            if ($('#hid_res').val() == 0)
            {

                CreateNewUser(name_user, form);
            }
            else
            {

                alert('×”×©×� ×ž×©×ª×ž×© × ×ž×¦×� ×‘×ž×¢×¨×›×ª');
            }
        }

    });

}
function get_edit_profil(id)//×ž×—×–×™×¨ ×�×ª ×”×¤×¨×˜×™×� ×©×œ ×”×ž×©×ª×ž×© 
{
    $.ajax({
        url: "ajax_new.php",
        data: "do=get_edit_profil&id=" + id,
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#lightbox_admin_content').html(result);
            $('#lightbox_admin, #lightbox_admin_frame').show();
        }


    });
}
function update_profil(id, pass, mail, status_send_mail)//×ž×—×–×™×¨ ×�×ª ×”×¤×¨×˜×™×� ×©×œ ×”×ž×©×ª×ž×© 
{
    $.ajax({
        url: "ajax_new.php",
        data: "do=update_profil&id=" + id + "&pass=" + pass + "&mail=" + mail + "&status_send_mail=" + status_send_mail,
        async: true,
        type: "POST",
        success: function(result)
        {
            alert('×”× ×ª×•× ×™×� × ×©×ž×¨×• ×‘×ž×¢×¨×›×ª');
            $('#lightbox_admin, #lightbox_admin_frame').hide();
        }


    });
}
function selector_status(id_project, id)//×ž×—×–×™×¨ ×�×ª ×”×¤×¨×˜×™×� ×©×œ ×”×ž×©×ª×ž×© 
{
    $.ajax({
        url: "ajax_new.php",
        data: "do=selector_status&id_project=" + id_project + "&id=" + id,
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#all_task').html(result);
        }


    });
}
function selector_all_option(id_project, status, from, to)//×ž×—×–×™×¨ ×�×ª ×”×¤×¨×˜×™×� ×©×œ ×”×ž×©×ª×ž×© 
{
    $.ajax({
        url: "ajax2.php",
        data: "do=selector_all_option&id_project=" + id_project + "&status=" + status + "&from=" + from + "&to=" + to,
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#all_task').html(result);
        }


    });
}
function selector_all_option_project(id_customer, status, from, to)//×ž×—×–×™×¨ ×�×ª ×”×¤×¨×˜×™×� ×©×œ ×”×ž×©×ª×ž×© 
{
    $.ajax({
        url: "ajax_new.php",
        data: "do=selector_all_option_project&id_customer=" + id_customer + "&status=" + status + "&from=" + from + "&to=" + to,
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#contectProjectOfStatus').html(result);
        }


    });
}
function selector_all_option_customer(id_customer, from, to)//×ž×—×–×™×¨ ×�×ª ×”×¤×¨×˜×™×� ×©×œ ×”×ž×©×ª×ž×© 
{
    $.ajax({
        url: "ajax2.php",
        data: "do=selector_all_option_customer&id_customer=" + id_customer + "&from=" + from + "&to=" + to,
        async: true,
        type: "POST",
        success: function(result)
        {
            //alert(result);
            $('#all_project_customer').html(result);
        }


    });
}
function get_from_dashboard(id)
{
    $.ajax({
        url: "ajax3.php",
        data: "do=get_from_dashboard&id=" + id,
        async: true,
        type: "POST",
        success: function(result)
        {

            $('#content').html(result);
        }

    });

}

function find_for_task(id_task)
{
    $.ajax({
        url: "ajax3.php",
        data: "do=find_for_task&id_task=" + id_task,
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#span_send_task').hide();
            $('#content').html(result);
            $('#select_customer').val('none');
            //alert(result);
        }

    });

}
function get_all_info_customer(id_customer)
{
    $('#select_customer_loader').css('display', 'block');
    $.ajax({
        url: "ajax2.php",
        data: "do=get_all_info_customer&id_customer=" + id_customer,
        async: true,
        type: "POST",
        success: function(result)
        {
            //alert(result);
            $('#span_send_task').css('display', 'none');
            $('#select_customer_loader').css('display', 'none');

            $('#content').html(result);
            //document.getElementById('content').innerHTML=result;

        }
    });
}
/*********************************************ajax_admin****************************************************************/
function goto_control_panel()//×ž×—×–×™×¨ ×�×ª ×›×œ ×”×”×•×“×¢×•×ª ×©×ž×—×›×•×ª ×œ×�×™×©×•×¨
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=goto_control_panel",
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#content').html(result);
            $('#select_customer').val('none');

        }


    });
}


function get_new_form_user()//×ž×—×–×™×¨ ×�×ª ×›×œ ×”×”×•×“×¢×•×ª ×©×ž×—×›×•×ª ×œ×�×™×©×•×¨
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=get_new_form_user",
        async: true,
        type: "POST",
        success: function(result)
        {

            $('#lightbox_admin_content').html(result);
            $('#lightbox_admin, #lightbox_admin_frame').show();

        }
    });
}

//{ 
//$.ajax({
//      url:"ajax_admin.php",
//	  data:"do=get_new_form_user",
//	  async:true,
//	  type:"POST",
//	  success:function(result)
//	  {		  
//		 $('#lightbox_admin_content').html(result);
//		$('#lightbox_admin, #lightbox_admin_frame').show();
//		 
//	  }


// });	
//	}	

function get_new_form_project()//×ž×—×–×™×¨ ×�×ª ×›×œ ×”×”×•×“×¢×•×ª ×©×ž×—×›×•×ª ×œ×�×™×©×•×¨
{
    $.ajax({
        url: "ajax_admin.php",
        //data:"do=get_new_form_project",
        data: "do=get_new_form_project",
        async: true,
        type: "POST",
        success: function(result)
        {

            $('#lightbox_admin_content').html(result);
            $('#lightbox_admin, #lightbox_admin_frame').show();

        }
    });
}

function get_new_form_customer()//×ž×—×–×™×¨ ×�×ª ×›×œ ×”×”×•×“×¢×•×ª ×©×ž×—×›×•×ª ×œ×�×™×©×•×¨
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=get_new_form_customer",
        async: true,
        type: "POST",
        success: function(result)
        {

            $('#lightbox_admin_content').html(result);
            $('#lightbox_admin, #lightbox_admin_frame').show();

        }


    });
}
function change_edit_project(id_customer)//×ž×—×–×™×¨ ×�×ª ×›×œ ×”×”×•×“×¢×•×ª ×©×ž×—×›×•×ª ×œ×�×™×©×•×¨
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=change_edit_project&id_customer=" + id_customer,
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#edit_project #project').html(result);

        }


    });
}
function change_form_edit_user(id_customer)
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=change_edit_project&id_customer=" + id_customer,
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#form_edit_user #project').html(result);

        }


    });
}

function change_new_user(id_customer)
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=change_edit_project&id_customer=" + id_customer,
        async: true,
        type: "POST",
        success: function(result)
        {
            $('.form_set #project').html(result);

        }


    });
}
function change_edit_user(id_customer)
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=change_edit_user&id_customer=" + id_customer,
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#edit_user #user_name').html(result);

        }


    });
}

function change_edit_user_add_project(id_customer)
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=change_edit_user_add_project&id_customer=" + id_customer,
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#form_edit_user #project').html(result);

        }


    });
}
function get_info_project(id_project)//×ž×—×–×™×¨ ×�×ª ×›×œ ×”×”×•×“×¢×•×ª ×©×ž×—×›×•×ª ×œ×�×™×©×•×¨
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=get_info_project&id_project=" + id_project,
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#lightbox_admin_content').html(result);
            $('#lightbox_admin, #lightbox_admin_frame').show();


        }


    });
}

function get_info_user(id_user)//×ž×—×–×™×¨ ×�×ª ×›×œ ×”×”×•×“×¢×•×ª ×©×ž×—×›×•×ª ×œ×�×™×©×•×¨
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=get_info_user&id_user=" + id_user,
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#lightbox_admin_content').html(result);
            $('#lightbox_admin, #lightbox_admin_frame').show();


        }


    });
}

function getAdmin(namefunc, id)//×ž×—×–×™×¨ ×�×ª ×›×œ ×”×”×•×“×¢×•×ª ×©×ž×—×›×•×ª ×œ×�×™×©×•×¨
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=Admin" + namefunc + "&id=" + id,
        async: true,
        type: "POST",
        success: function(result)
        {
            $('#Adminedit_user').html(result);

        }


    });
}
function changeActive(nameTable, NameId, id, active)// ×ž×§×‘×œ×ª ×©×� ×˜×‘×œ×” ×•×ž×©× ×” ×�×ª  ×”×ž×¦×‘ ×©×œ×” 
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=changeActive&nameTable=" + nameTable + "&id=" + id + "&active=" + active + "&NameId=" + NameId,
        async: true,
        type: "post",
        success: function(result)
        {
            alert('×”×©×™× ×•×™ ×‘×•×¦×¢');

            //window.location.reload( false );

        }

    });

}

function get_edit_customer(id_customer)// ×ž×§×‘×œ×ª ×©×� ×˜×‘×œ×” ×•×ž×©× ×” ×�×ª  ×”×ž×¦×‘ ×©×œ×” 
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=get_edit_customer&id_customer=" + id_customer,
        async: true,
        type: "post",
        success: function(result)
        {
            $('#lightbox_admin_content').html(result);
            $('#lightbox_admin, #lightbox_admin_frame').show();
        }

    });

}
function get_LookProfilCustomer(id_customer)// ×ž×§×‘×œ×ª ×©×� ×˜×‘×œ×” ×•×ž×©× ×” ×�×ª  ×”×ž×¦×‘ ×©×œ×” 
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=get_LookProfilCustomer&id_customer=" + id_customer,
        async: true,
        type: "post",
        success: function(result)
        {
            $('#lightbox_admin_content').html(result);
            $('#lightbox_admin, #lightbox_admin_frame').show();
        }

    });

}
function add_permissions(id_project, user_id)
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=add_permissions&id_project=" + id_project + "&user_id=" + user_id,
        async: true,
        type: "post",
        success: function(result)
        {
            getAdmin('edit_user', user_id);
            $('#er').html(result);
        }

    });

}

function CreateNewUserOfCompany(id_custimer)
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=CreateNewUserOfCompany&id_custimer=" + id_custimer,
        async: true,
        type: "post",
        success: function(result)
        {

            $('#test').html(result);
        }

    });

}
function CreateNewUserOfProject(id_custimer)
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=CreateNewUserOfProject&id_custimer=" + id_custimer,
        async: true,
        type: "post",
        success: function(result)
        {

            $('#test').html(result);
        }

    });

}

function  CreateNewUser(name_user, form)
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=CreateNewUser&" + form,
        async: true,
        type: "post",
        success: function(result)
        {

            $('#cart div ol').append('<li >' + name_user + '</li> ');
            $('#cart div ol').append(result);
        }

    });

}
function  Delete(id, project)
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=Delete&id=" + id + "&project=" + project,
        async: true,
        type: "post",
        success: function(result)
        {

            //alert("×”×•×¡×¨×” ×”×”×¨×©×�×” ×©×œ ×”×ž×©×ª×ž×© ×ž×”×¤×¨×•×™×™×§×˜ ×”× ×•×›×—×™ ");
            $('#cart #' + id).remove();
        }

    });

}
function  sendWeeklyReport()
{
    $.ajax({
        url: "ajax_admin.php",
        data: "do=sendWeeklyReport",
        async: true,
        type: "post",
        success: function(result)
        {


        }

    });

}

